'''
Auther:CZero
Date:20201106
'''

import random

str = 'abcdefghijklmnopqrstuvwxyz'
list_str = []

for i in range(100):
    #随机挑选2个字母组成字符串
    list = ''.join(random.sample(str,2))
    list_str.append(list)
print(list_str)

#统计字符串出现的次数
count = {}
for j in list_str:
    if j in count:
        count[j] += 1
    else:
        count[j] = 1
        
#降序输出不同的字符串及重复的次数
print(sorted(count.items(), key = lambda x:x[1],reverse=True))

# 完成的不错
